package com.smile.service.entity.config;

import com.alibaba.fastjson2.annotation.JSONField;

public class DeviceConfigInfo {

    @JSONField(name = "config_scope")
    private String configScope;

    @JSONField(name = "config_type")
    private String configType;

    // 无参构造
    public DeviceConfigInfo() {}

    // 全参构造
    public DeviceConfigInfo(String configScope, String configType) {
        this.configScope = configScope;
        this.configType = configType;
    }

    // Getter & Setter
    public String getConfigScope() {
        return configScope;
    }

    public void setConfigScope(String configScope) {
        this.configScope = configScope;
    }

    public String getConfigType() {
        return configType;
    }

    public void setConfigType(String configType) {
        this.configType = configType;
    }

    // 实用方法 - 判断是否为产品配置
    public boolean isProductConfig() {
        return "product".equals(configScope);
    }

    // 实用方法 - 判断是否为JSON格式
    public boolean isJsonConfig() {
        return "json".equals(configType);
    }

    // 实用方法 - 获取配置组合描述
    public String getConfigDescription() {
        return String.format("%s配置 (%s格式)",
                configScope,
                configType.toUpperCase());
    }

    @Override
    public String toString() {
        return "DeviceConfigInfo[" +
                "configScope='" + configScope + '\'' +
                ", configType='" + configType + '\'' +
                ']';
    }
}
